<?php 
if(_is_sqlserver()){
	$sql = "select pk_record, c_code from t_onegate_record where datediff(day,C_APPOINTED_DATE, '2008-04-10') >= 0 and (c_current_status = 'CAP_PHEP' or c_current_status = 'TU_CHOI') and C_DETAIL_STATUS<>51";
	$ado_conn->SetFetchMode(ADODB_FETCH_ASSOC);
	$array_record = $ado_conn->GetAll($sql);
	_write_log_file('list_record.log','-------------------Cac ho so ton cua Bui Quang Nghia : '.sizeof($array_record).'--------------------------');
	for ($i = 0; $i < sizeof($array_record); $i ++) {
		_write_log_file('list_record.log', $array_record[$i]['c_code']);
		$sql = "Exec Onegate_RecordLicenceUpdate ".$array_record[$i]['pk_record'].",'2008-04-25','UB',0,1858,'2008-04-25',1" ;
		//echo $sql ; exit;
		$ado_conn->SetFetchMode(ADODB_FETCH_ASSOC);
		$rs = $ado_conn->GetRow($sql); 
		$v_error = _replace_bad_char(trim($rs['RET_ERROR']));
	}
	_write_log_file('list_record.log','---------------------------------------------------------------------');
}
?>